﻿<%@ Page Language="C#" AutoEventWireup="true" Codebehind="Default.aspx.cs" Inherits="WCSFContrib.ECommerceCatalog.Admin.Views.Admin_Default"
    Title="Default" MasterPageFile="~/Shared/Default.master" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Register Assembly="Microsoft.Practices.Web.UI.WebControls" Namespace="Microsoft.Practices.Web.UI.WebControls"
    TagPrefix="WebControls" %>
    
<asp:Content ID="content" ContentPlaceHolderID="DefaultContent" Runat="Server">
    <h1>Administration Site</h1>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
	    <ContentTemplate>
	        <h3>Orders</h3>
            <asp:GridView ID="OrdersGridView" runat="server" AutoGenerateColumns="False" DataSourceID="OrdersObjectContainerDataSource"
			    EmptyDataText="No orders." DataKeyNames="OrderId" AllowPaging="True" AllowSorting="True">
			    <Columns>
			        <asp:BoundField DataField="OrderId" HeaderText="Order No" ReadOnly="True" SortExpression="OrderId" />
                    <asp:BoundField DataField="User" HeaderText="User" ReadOnly="True" SortExpression="User" >
                        <ItemStyle Width="100px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Status" SortExpression="OrderStatus">
                        <EditItemTemplate>
                            <asp:DropDownList ID="OrderStatusDropDown" SelectedValue='<%# Bind("OrderStatus") %>' runat="server">
                                <asp:ListItem Value="Open" Text="Open" />
                                <asp:ListItem Value="ReadyToShip" Text="ReadyToShip" />
                                <asp:ListItem Value="Shipped" Text="Shipped" />
                                <asp:ListItem Value="Canceled" Text="Canceled" />
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="OrderStatusLabel" Text='<%# Eval("OrderStatus") %>' runat="server" />
                        </ItemTemplate>
                        <ControlStyle Width="110px" />
                    </asp:TemplateField>
			        <asp:BoundField DataField="OrderDate" HeaderText="Date" ReadOnly="True" SortExpression="OrderDate" />
			        <asp:BoundField DataField="Total" HeaderText="Total" HtmlEncode="False" DataFormatString="{0:C}" ReadOnly="True" SortExpression="Total" />
			        <asp:CommandField CancelImageUrl="~/Admin/Images/remove.png" EditImageUrl="~/Admin/Images/edit.png"
                        ShowEditButton="True" UpdateImageUrl="~/Admin/Images/button_ok.png" ButtonType="Image" />
			    </Columns>
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
		    </asp:GridView>
		    <WebControls:ObjectContainerDataSource ID="OrdersObjectContainerDataSource" runat="server"
                DataObjectTypeName="WCSFContrib.ECommerceCatalog.BusinessEntities.Order" OnUpdated="OrdersObjectContainerDataSource_Updated" />
                
            <br />
            
            <h3>Users</h3>
            <asp:GridView ID="UsersGridView" runat="server" AutoGenerateColumns="False"
			    EmptyDataText="No users." DataKeyNames="UserName" AllowPaging="True" AllowSorting="True">
			    <Columns>
			        <asp:BoundField DataField="UserName" HeaderText="UserName" />
                    <asp:BoundField DataField="Email" HeaderText="E-mail" />
                    <asp:CheckBoxField DataField="IsLockedOut" HeaderText="Is Locked Out?" >
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:CheckBoxField>
			    </Columns>
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
		    </asp:GridView>
	    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

